﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Background.Entity;
using Web.Commons;
using System.IO;
using VCommons;
namespace Common.Background.Web.Controllers
{
    public abstract class BackgroundBaseController : BaseController
    {
        public BackgroundBaseController()
        {
            Background_Current_UserID = string.IsNullOrEmpty(SessionAction.ReadSession("Background_Current_UserID"))
                ? -new Random().Next(2, 99999)
                : Convert.ToInt32(SessionAction.ReadSession("Background_Current_UserID"));
            Background_Current_UserName = SessionAction.ReadSession("Background_Current_UserName");
            Background_Current_Dept = string.IsNullOrEmpty(SessionAction.ReadSession("Background_Current_Dept"))
            ? 0
            : Convert.ToInt32(SessionAction.ReadSession("Background_Current_Dept"));
        }
        /// <summary>
        /// 用户权限：后台
        /// </summary>
        protected virtual UserOperatorRole UserOperatorRole { get; set; }
        /// <summary>
        /// 当前的用户ID：后台
        /// </summary>
        protected virtual int Background_Current_UserID { get; set; }

        /// <summary>
        /// 当前登陆的用户名：后台
        /// </summary>
        protected virtual string Background_Current_UserName { get; set; }

        /// <summary>
        /// 当前用户的部门ID
        /// </summary>
        protected virtual int Background_Current_Dept { get; set; }
    }
}
